package com.sg.service.base.calc.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sg.common.util.CommonFunctionHelper;
import com.sg.common.util.RedisUtil;
import com.sg.dto.base.calc.req.*;
import com.sg.entity.OmsStandardDataResult;
import com.sg.service.base.calc.MOmsStandardDataResultService;
import com.wicket.okrcalc.common.annotations.BanAuto;
import com.wicket.okrcalc.common.dto.FieldInfo;
import com.wicket.okrcalc.common.exception.BizException;
import com.wicket.okrcalc.dal.mapper.mbg.OmsStandardDataResultMapper;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;


/**
 * @author ：
 * @version 1.0
 * @since 2022/1/19 15:39
 */
@Service
public class MOmsStandardDataResultServiceImpl
        extends ServiceImpl<OmsStandardDataResultMapper, OmsStandardDataResult>
        implements MOmsStandardDataResultService {

    @Autowired
    OmsStandardDataResultMapper omsStandardDataResultMapper;

    /**
     * 4-01-01批量查标准数据列表[2228]
     * gen by moon at 12/10/2022, 4:49:12 PM
     */
    @Trace(operationName = "4-01-01批量查标准数据列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataLIst(BatchQueryStandardDataLIstReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("entity_id", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01批量查标准数据By归属内容主键ID[2466]
     * gen by moon at 10/22/2024, 12:06:28 AM
     */
    @Trace(operationName = "4-01-01批量查标准数据By归属内容主键ID")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataByEntityId(BatchQueryStandardDataByEntityIdReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("entity_id", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("data_result");
            queryWrapper.orderByDesc("create_time");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01查标准数据详情[2696]
     * gen by moon at 10/22/2024, 1:16:30 PM
     */
    @Trace(operationName = "4-01-01查标准数据详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsStandardDataResult queryStandardDataDetail(QueryStandardDataDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();

            // TODO: 2024/6/16  
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.ge("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.le("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsStandardDataResult> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsStandardDataResult retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01新增标准数据[2856]
     * gen by moon at 7/7/2023, 4:49:26 PM
     */
    @Trace(operationName = "4-01-01新增标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addStandardData(OmsStandardDataResult omsStandardDataResult) {
        omsStandardDataResult.setDataResultId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsStandardDataResult.setIsSystemDocking("FALSE");
        omsStandardDataResult.setIsArchive("FALSE");
        omsStandardDataResult.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsStandardDataResult.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        if (omsStandardDataResult != null && omsStandardDataResult.getSubjectLifeCycle() != null && omsStandardDataResult.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsStandardDataResult.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//RELEASED_CURRENT_INDUCTIONID
        }
        omsStandardDataResult.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsStandardDataResult.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        if (omsStandardDataResult != null && omsStandardDataResult.getSubjectLifeCycle() != null && omsStandardDataResult.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsStandardDataResult.setReleaseTime(CommonFunctionHelper.getCurrentTime());//RELEASE_SYSTEM_CURRENT_TIME
        }
        omsStandardDataResult.setIsValid("FALSE");
        omsStandardDataResult.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsStandardDataResult.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        omsStandardDataResult.setIsNewData("TRUE");
        omsStandardDataResult.setIsUpdateCycleNewData("TRUE");
        if (super.save(omsStandardDataResult)) {
            return omsStandardDataResult.getDataResultId();
        } else {
            return "-1";
        }

    }

    /**
     * 4-01-01修改标准数据[2860]
     * gen by moon at 12/10/2022, 4:49:15 PM
     */
    @Trace(operationName = "4-01-01修改标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateStandardData(OmsStandardDataResult omsStandardDataResult) {
        omsStandardDataResult.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsStandardDataResult.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        return super.updateById(omsStandardDataResult);
    }

    /**
     * 4-01-01批量查询切片标准数据[3158]
     * gen by moon at 9/3/2022, 4:51:20 PM
     */
    @Trace(operationName = "4-01-01批量查询切片标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    @BanAuto
    public List<OmsStandardDataResult> batchQuerySectionStandardData(BatchQuerySectionStandardDataReq reqDto) {
        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            if (reqDto.getSectionStandardDataList() == null || reqDto.getSectionStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            //将内容标识提取出来，要注意 这个地方的in 不是使用主键，要使用同名字段.
            List<String> ids = reqDto.getSectionStandardDataList().stream().map(SectionStandardDataDto::getEntityId).collect(Collectors.toList());
            queryWrapper.in("entity_id", ids);

            //正常构建查询条件
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            queryWrapper.orderByDesc("operate_time");

            //执行查询
            List<OmsStandardDataResult> retListDataTmp = super.list(queryWrapper);
            if (reqDto.getSectionStandardDataList() != null && reqDto.getSectionStandardDataList().size() > 0) {
                if (reqDto.getSectionStandardDataList().get(0).getCycleStartTime() == null) {
                    return retListDataTmp;
                }
            }

            //先构建索引
            Map<String, SectionStandardDataDto> indexInfo = new HashMap<>();
            for (SectionStandardDataDto oneMember : reqDto.getSectionStandardDataList()) {
                indexInfo.put(oneMember.getEntityId(), oneMember);
            }
            //按时间过滤
            Map<String, List<OmsStandardDataResult>> retMapByDate = new HashMap<>();
            for (OmsStandardDataResult oneData : retListDataTmp) {
                SectionStandardDataDto standData = indexInfo.get(oneData.getEntityId());
                //此处时间字段，一定是同名字段
                if (standData.getCycleEndTime().compareTo(oneData.getCycleStartTime()) >= 0 && standData.getCycleEndTime().compareTo(oneData.getCycleEndTime()) <= 0) {
                    if (!retMapByDate.containsKey(oneData.getEntityId())) {
                        List<OmsStandardDataResult> elmList = new ArrayList<>();
                        elmList.add(oneData);
                        retMapByDate.put(oneData.getEntityId(), elmList);
                    } else {
                        retMapByDate.get(oneData.getEntityId()).add(oneData);
                    }
                }
            }
            //按内容id取最新一条
            List<OmsStandardDataResult> retListData = new ArrayList<>();
            for (Map.Entry<String, List<OmsStandardDataResult>> oneEntry : retMapByDate.entrySet()) {
                retListData.add(oneEntry.getValue().get(0));
            }

            return retListData;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }

    }

    /**
     * 4-01-01查询标准数据列表ByCodes（角色）[3573]
     * gen by moon at 12/17/2022, 5:45:59 AM
     */
    @Trace(operationName = "4-01-01查询标准数据列表ByCodes（角色）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataListByCodes(BatchQueryStandardDataListByCodesReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("biz_role_obj_code", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01查询标准数据列表By周期ID[3714]
     * gen by moon at 1/26/2023, 3:18:22 PM
     */
    @Trace(operationName = "4-01-01查询标准数据列表By周期ID")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataListByIds(BatchQueryStandardDataListByIdsReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getCycleList() == null || reqDto.getCycleList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("period_id", reqDto.getCycleList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01批量删标准数据[4216]
     * gen by moon at 12/10/2022, 4:49:17 PM
     */
    @Trace(operationName = "4-01-01批量删标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeleteStandardData(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * M-构造被评对象目标周期标准数据验证数据[4255]
     * gen by moon at 12/10/2022, 4:49:18 PM
     */
    @Trace(operationName = "M-构造被评对象目标周期标准数据验证数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String buildEvaObjTarCycStaData(OmsStandardDataResult omsStandardDataResult) {
        omsStandardDataResult.setDataResultId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsStandardDataResult.setSubjectLifeCycle("CURRENTLY_VALID");
        omsStandardDataResult.setIsArchive("FALSE");
        omsStandardDataResult.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsStandardDataResult.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        if (omsStandardDataResult != null && omsStandardDataResult.getSubjectLifeCycle() != null && omsStandardDataResult.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsStandardDataResult.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//RELEASED_CURRENT_INDUCTIONID
        }
        omsStandardDataResult.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsStandardDataResult.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        if (omsStandardDataResult != null && omsStandardDataResult.getSubjectLifeCycle() != null && omsStandardDataResult.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsStandardDataResult.setReleaseTime(CommonFunctionHelper.getCurrentTime());//RELEASE_SYSTEM_CURRENT_TIME
        }
        omsStandardDataResult.setIsValid("FALSE");
        omsStandardDataResult.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsStandardDataResult.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsStandardDataResult)) {
            return omsStandardDataResult.getDataResultId();
        } else {
            return "-1";
        }

    }

    /**
     * M4-查询多条被评对象目标周期标准数据列表[4373]
     * gen by moon at 12/10/2022, 4:49:19 PM
     */
    @Trace(operationName = "M4-查询多条被评对象目标周期标准数据列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> queryMultiEvaObjTarCycStaDataList(QueryMultiEvaObjTarCycStaDataListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();

            if (reqDto.getMultiEvaObjTarCycStaDataList() == null || reqDto.getMultiEvaObjTarCycStaDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("belong_to_content_id", reqDto.getMultiEvaObjTarCycStaDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M4-批量删多条被评对象目标周期标准数据[4374]
     * gen by moon at 12/10/2022, 4:49:19 PM
     */
    @Trace(operationName = "M4-批量删多条被评对象目标周期标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeleteMultiEvaObjTarCycStaData(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * M4-查询单条被评对象目标周期标准数据列表[4380]
     * gen by moon at 12/10/2022, 4:49:20 PM
     */
    @Trace(operationName = "M4-查询单条被评对象目标周期标准数据列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> querySingleEvaObjTarCycStaDataList(QuerySingleEvaObjTarCycStaDataListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M4-删除单条被评对象目标周期标准数据[4381]
     * gen by moon at 12/10/2022, 4:49:21 PM
     */
    @Trace(operationName = "M4-删除单条被评对象目标周期标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteSingleEvaObjTarCycStaData(String dataResultId) {

        return super.removeById(dataResultId);
    }

    /**
     * M4-1-01一键删除被评对象目标周期标准数据验证数据[4425]
     * gen by moon at 12/10/2022, 4:49:21 PM
     */
    @Trace(operationName = "M4-1-01一键删除被评对象目标周期标准数据验证数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean autoDeleteEvaObjTarCycStaData(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * M4-1-01查询被评对象目标周期标准数据列表[4460]
     * gen by moon at 4/21/2023, 10:00:28 PM
     */
    @Trace(operationName = "M4-1-01查询被评对象目标周期标准数据列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> queryEvaObjTarCycStaDataList(QueryEvaObjTarCycStaDataListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01查询标准数据（基础）列表[4495]
     * gen by moon at 5/9/2023, 5:51:23 AM
     */
    @Trace(operationName = "4-01-01查询标准数据（基础）列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> queryStandardDataBaseList(QueryStandardDataBaseListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByAsc("create_time");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M4-1-01查询单条被评对象目标周期标准数据详情[4536]
     * gen by moon at 3/30/2023, 12:55:41 PM
     */
    @Trace(operationName = "M4-1-01查询单条被评对象目标周期标准数据详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsStandardDataResult querySingleEvaObjTarCycStaDataDetail(QuerySingleEvaObjTarCycStaDataDetailReq reqDto) {

        try {

            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsStandardDataResult> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsStandardDataResult retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M4-1-01修改单条被评对象目标周期标准数据[4537]
     * gen by moon at 12/10/2022, 4:49:24 PM
     */
    @Trace(operationName = "M4-1-01修改单条被评对象目标周期标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateSingleEvaObjTarCycStaData(OmsStandardDataResult omsStandardDataResult) {

        return super.updateById(omsStandardDataResult);
    }

    /**
     * 4-01-01批量查询标准数据by周期阶段资料[4542]
     * gen by moon at 12/10/2022, 4:49:25 PM
     */
    @Trace(operationName = "4-01-01批量查询标准数据by周期阶段资料")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataByStageData(BatchQueryStandardDataByStageDataReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getCycleStageDataList() == null || reqDto.getCycleStageDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("from_content_entity_id", reqDto.getCycleStageDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01查询被评对象目标周期标准数据列表[4803]
     * gen by moon at 12/18/2022, 1:14:22 AM
     */
    @Trace(operationName = "4-1-01查询被评对象目标周期标准数据列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> queryEvaObjTargetCycleDataList(QueryEvaObjTargetCycleDataListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01批量新增标准数据[3014]
     * gen by moon at 12/11/2022, 7:21:43 PM
     */
    @Trace(operationName = "4-01-01批量新增标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchAddStandardData(List<OmsStandardDataResult> omsStandardDataResult) {

        if (omsStandardDataResult == null || omsStandardDataResult.size() == 0) {
            return false;
        }

        return super.saveBatch(omsStandardDataResult.stream().map(item -> {
            item.setDataResultId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
            item.setIsArchive("FALSE");
            item.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setIsValid("FALSE");
            item.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            item.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            return item;
        }).collect(Collectors.toList()));
    }

    /**
     * 4-01-01批量查询组织或人匹配标准数据[5480]
     * gen by moon at 2/5/2024, 7:12:47 PM
     */
    @Trace(operationName = "4-01-01批量查询组织或人匹配标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryOrgOrMatchingStandardData(BatchQueryOrgOrMatchingStandardDataReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();

            if (reqDto.getOrgOrMatchingStandardDataList() == null || reqDto.getOrgOrMatchingStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            // TODO: 2024/2/20  
            queryWrapper.in("person_liable_obj_id", reqDto.getOrgOrMatchingStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01批量查询标准数据列表by评价人[5484]
     * gen by moon at 1/14/2024, 6:39:06 PM
     */
    @Trace(operationName = "4-01-01批量查询标准数据列表by评价人")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataByEvaluate(BatchQueryStandardDataByEvaluateReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            if (reqDto.getTaskParticipationEvaluateList() == null || reqDto.getTaskParticipationEvaluateList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("person_liable_obj_id", reqDto.getTaskParticipationEvaluateList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01查询时间范围标准数据列表[5654]
     * gen by moon at 1/11/2023, 5:51:30 AM
     */
    @Trace(operationName = "4-01-01查询时间范围标准数据列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    @BanAuto
    public List<OmsStandardDataResult> queryTimeRangeStandardDataList(QueryTimeRangeStandardDataListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");

            // TODO: 2024/6/16
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }

            if (reqDto.getCreateTime() != null) {
                queryWrapper.le("create_time", reqDto.getCreateTime());
                reqDto.setCreateTime(null);
            }
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01批量改标准数据[5688]
     * gen by moon at 2/5/2024, 7:12:48 PM
     */
    @Trace(operationName = "4-01-01批量改标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchUpdateStandardData(List<OmsStandardDataResult> omsStandardDataResult) {

        if (omsStandardDataResult == null || omsStandardDataResult.size() == 0) {
            return false;
        }
        // TODO: 2023/6/11 临时手写代码
        for (OmsStandardDataResult one : omsStandardDataResult) {
            one.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());
            one.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());
            one.setOperateTime(CommonFunctionHelper.getCurrentTime());
        }
        return super.saveOrUpdateBatch(omsStandardDataResult);

    }

    /**
     * 4-1-01批量查询标准数据by数据类型编码[5979]
     * gen by moon at 2/23/2023, 7:02:04 PM
     */
    @Trace(operationName = "4-1-01批量查询标准数据by数据类型编码")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataByDataType(BatchQueryStandardDataByDataTypeReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            if (reqDto.getDataTypeList() == null || reqDto.getDataTypeList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("data_type", reqDto.getDataTypeList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }


    /**
     * 4-01-01查询标准数据列表by更新周期时间范围测试[9999999]
     * gen by moon at 2/23/2023, 7:02:04 PM
     */
    @Trace(operationName = "4-01-01查询标准数据列表by更新周期时间范围测试")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> queryStandardDataByUpdateCycleTimeRangeTestList(QueryStandardDataByUpdateCycleTimeRangeTestListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");

            if (reqDto.getUpdateCycleStartTime() != null && reqDto.getUpdateCycleEndTime() != null) {
                queryWrapper.ge("update_cycle_start_time", reqDto.getUpdateCycleStartTime());
                queryWrapper.le("update_cycle_end_time", reqDto.getUpdateCycleEndTime());
                reqDto.setUpdateCycleStartTime(null);
                reqDto.setUpdateCycleEndTime(null);
            }


            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01批量查标准数据by工作周期更新切片列表[6278]
     * gen by moon at 4/15/2023, 9:16:14 PM
     */
    @Trace(operationName = "4-1-01批量查标准数据by工作周期更新切片列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> queryStandardDataByWorkCycleUpdateSliceList(QueryStandardDataByWorkCycleUpdateSliceListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            if (reqDto.getCycleStageDataList() == null || reqDto.getCycleStageDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("work_cycle_update_slice", reqDto.getCycleStageDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M4-执行重新计算全模版标准数据【循环开始】[7239]
     * gen by moon at 6/25/2023, 4:52:03 PM
     */
    @Trace(operationName = "M4-执行重新计算全模版标准数据【循环开始】")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsStandardDataResult implementRecalcEvaTempAllDataLoopStart(ImplementRecalcEvaTempAllDataLoopStartReq reqDto) {

        try {

            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsStandardDataResult> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsStandardDataResult retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01查询标准数据列表by更新周期时间范围[7297]
     * gen by moon at 11/8/2023, 1:20:17 AM
     */
    @Trace(operationName = "4-01-01查询标准数据列表by更新周期时间范围")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> queryStandardDataByUpdateCycleTimeRangeList(QueryStandardDataByUpdateCycleTimeRangeListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
// TODO: 2024/7/16
            if (reqDto.getUpdateCycleStartTime() != null && reqDto.getUpdateCycleEndTime() != null) {
                queryWrapper.ge("update_cycle_start_time", reqDto.getUpdateCycleStartTime());
                queryWrapper.le("update_cycle_end_time", reqDto.getUpdateCycleEndTime());
                reqDto.setUpdateCycleStartTime(null);
                reqDto.setUpdateCycleEndTime(null);
            }
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01查标准数据列表（归属周期开始大于等于&归属周期结束小于等于）[7719]
     * gen by moon at 7/16/2024, 12:47:51 AM
     */
    @Trace(operationName = "4-01-01查标准数据列表（归属周期开始大于等于&归属周期结束小于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> queryStandardDataList(QueryStandardDataListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
// TODO: 2024/7/16
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.ge("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.le("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("create_time");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01批量查询标准数据[7721]
     * gen by moon at 11/8/2023, 1:20:22 AM
     */
    @Trace(operationName = "4-1-01批量查询标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardData(BatchQueryStandardDataReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("data_result_id", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01执行周期起止时间查标准数据列表[7727]
     * gen by moon at 11/8/2023, 1:20:23 AM
     */
    @Trace(operationName = "4-1-01执行周期起止时间查标准数据列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> implementCycleStartEndTimeQueryStandardData(ImplementCycleStartEndTimeQueryStandardDataReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01执行数据值结果自动加[8366]
     * gen by moon at 1/31/2024, 4:36:21 AM
     */
    @Trace(operationName = "4-1-01执行数据值结果自动加")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean implementDataResultAdd(OmsStandardDataResult omsStandardDataResult) {

        return super.updateById(omsStandardDataResult);
    }

    /**
     * 4-1-01执行数据值结果自动减[8367]
     * gen by moon at 1/31/2024, 4:36:22 AM
     */
    @Trace(operationName = "4-1-01执行数据值结果自动减")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean implementDataResultReduction(OmsStandardDataResult omsStandardDataResult) {
        if (omsStandardDataResult.getDataResult() != null) {
            omsStandardDataResult.setDataResult(omsStandardDataResult.getDataResult() - 1);//AUTO_SUB
        }
        return super.updateById(omsStandardDataResult);
    }

    /**
     * 4-1-01新增数据点标准数据[8557]
     * gen by moon at 3/8/2024, 3:30:08 AM
     */
    @Trace(operationName = "4-1-01新增数据点标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addDataPointStandardData(OmsStandardDataResult omsStandardDataResult) {
        omsStandardDataResult.setDataResultId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsStandardDataResult.setIsArchive("FALSE");
        if (omsStandardDataResult != null && omsStandardDataResult.getSubjectLifeCycle() != null && omsStandardDataResult.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsStandardDataResult.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//RELEASED_CURRENT_INDUCTIONID
        }
        omsStandardDataResult.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsStandardDataResult.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        if (omsStandardDataResult != null && omsStandardDataResult.getSubjectLifeCycle() != null && omsStandardDataResult.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsStandardDataResult.setReleaseTime(CommonFunctionHelper.getCurrentTime());//RELEASE_SYSTEM_CURRENT_TIME
        }
        omsStandardDataResult.setIsValid("FALSE");
        omsStandardDataResult.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsStandardDataResult.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsStandardDataResult)) {
            return omsStandardDataResult.getDataResultId();
        } else {
            return "-1";
        }

    }

    /**
     * 4-1-01修改数据点标准数据[8558]
     * gen by moon at 3/8/2024, 3:30:09 AM
     */
    @Trace(operationName = "4-1-01修改数据点标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateDataPointStandardData(OmsStandardDataResult omsStandardDataResult) {
        if (omsStandardDataResult != null && omsStandardDataResult.getSubjectLifeCycle() != null && omsStandardDataResult.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsStandardDataResult.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//RELEASED_CURRENT_INDUCTIONID
        }
        omsStandardDataResult.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        if (omsStandardDataResult != null && omsStandardDataResult.getSubjectLifeCycle() != null && omsStandardDataResult.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsStandardDataResult.setReleaseTime(CommonFunctionHelper.getCurrentTime());//RELEASE_SYSTEM_CURRENT_TIME
        }
        return super.updateById(omsStandardDataResult);
    }

    /**
     * 4-1-01批量查询归属主体标准数据By数据归属内容表主键ID[8846]
     * gen by moon at 3/28/2024, 3:42:28 PM
     */
    @Trace(operationName = "4-1-01批量查询归属主体标准数据By数据归属内容表主键ID")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataOfObjectByContentId(BatchQueryStandardDataOfObjectByContentIdReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("belong_to_content_id", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01批量查询归属主体标准数据By数据归属对象ID[8848]
     * gen by moon at 3/28/2024, 3:42:32 PM
     */
    @Trace(operationName = "4-1-01批量查询归属主体标准数据By数据归属对象ID")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataOfObjectByIdentityId(BatchQueryStandardDataOfObjectByIdentityIdReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("belong_to_personal_identity_id", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01批量查询归属主体标准数据By数据点类型[8852]
     * gen by moon at 3/28/2024, 11:59:18 PM
     */
    @Trace(operationName = "4-1-01批量查询归属主体标准数据By数据点类型")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataOfObjectByDataType(BatchQueryStandardDataOfObjectByDataTypeReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();

            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("data_type", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01新增大屏标准数据[8939]
     * gen by moon at 3/31/2024, 2:03:58 AM
     */
    @Trace(operationName = "4-1-01新增大屏标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addDashboradStandardData(OmsStandardDataResult omsStandardDataResult) {
        omsStandardDataResult.setDataResultId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsStandardDataResult.setIsArchive("FALSE");
        omsStandardDataResult.setIsValid("FALSE");
        if (super.save(omsStandardDataResult)) {
            return omsStandardDataResult.getDataResultId();
        } else {
            return "-1";
        }

    }

    /**
     * 4-1-01查询大屏标准数据详情[8940]
     * gen by moon at 3/31/2024, 2:04:01 AM
     */
    @Trace(operationName = "4-1-01查询大屏标准数据详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsStandardDataResult queryDashboradStandardDataDetail(QueryDashboradStandardDataDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsStandardDataResult> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsStandardDataResult retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01修改大屏标准数据[8941]
     * gen by moon at 3/31/2024, 2:04:03 AM
     */
    @Trace(operationName = "4-1-01修改大屏标准数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateDashboradStandardData(OmsStandardDataResult omsStandardDataResult) {

        return super.updateById(omsStandardDataResult);
    }

    /**
     * 4-1-01批量查询标准数据By归属内容主键ID（从小到大）[9059]
     * gen by moon at 4/2/2024, 6:27:03 PM
     */
    @Trace(operationName = "4-1-01批量查询标准数据By归属内容主键ID（从小到大）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataByEntityIdSmallToLarge(BatchQueryStandardDataByEntityIdSmallToLargeReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();

            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("entity_id", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByAsc("data_result");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-1批量查询标准数据by周期阶段资料ID[9494]
     * gen by moon at 5/2/2024, 3:10:33 AM
     */
    @Trace(operationName = "4-1-1批量查询标准数据by周期阶段资料ID")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataByCycleStageData(BatchQueryStandardDataByCycleStageDataReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("from_content_entity_id", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M4查询修复标准数据列表[9796]
     * gen by moon at 6/13/2024, 4:07:35 PM
     */
    @Trace(operationName = "M4查询修复标准数据列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> queryRepairStandardDataList(QueryRepairStandardDataListReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("cycle_end_time");
            queryWrapper.orderByDesc("update_cycle_end_time");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01查询标准数据(开始时间小于结束时间大于等于)详情[9803]
     * gen by moon at 6/14/2024, 6:46:03 PM
     */
    @Trace(operationName = "4-1-01查询标准数据(开始时间小于结束时间大于等于)详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsStandardDataResult queryStandardDataStartLessEndBigEqualDetail(QueryStandardDataStartLessEndBigEqualDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();

            // TODO: 2024/10/20
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.lt("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsStandardDataResult> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsStandardDataResult retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01批量查询标准数据By更新周期切片（从大到小）[9900]
     * gen by moon at 6/30/2024, 2:44:10 AM
     */
    @Trace(operationName = "4-1-01批量查询标准数据By更新周期切片（从大到小）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryWorkCycleUpdateSliceListByIds(BatchQueryWorkCycleUpdateSliceListByIdsReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();

            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("work_cycle_update_slice", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("data_result");
            queryWrapper.orderByDesc("create_time");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-1-01批量查询标准数据By更新周期切片（从小到大）[9901]
     * gen by moon at 6/30/2024, 2:44:14 AM
     */
    @Trace(operationName = "4-1-01批量查询标准数据By更新周期切片（从小到大）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryWorkCycleUpdateSliceSmallToLargeListByIds(BatchQueryWorkCycleUpdateSliceSmallToLargeListByIdsReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();

            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("work_cycle_update_slice", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByAsc("data_result");
            queryWrapper.orderByDesc("create_time");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    @Resource
    private RedisUtil redisUtil;

    /**
     * 4-1-01执行标准数据悬停[9937]
     * gen by moon at 7/7/2024, 6:28:16 PM
     */
    @Trace(operationName = "4-1-01执行标准数据悬停")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsStandardDataResult implementStandardDataHover(ImplementStandardDataHoverReq reqDto) {

        redisUtil.set("调试:4-1-01执行标准数据悬停-入参", reqDto);
        try {
            long count = 2000;
            while (true) {
                if (count == 0) {
                    break;
                }
                //reqDto.setIsValid("FALSE");
                QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
                Map<String, Object> fieldInfoMap = null;
                fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
                CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
                redisUtil.set("调试:4-1-01执行标准数据悬停-转map值", fieldInfoMap);
                queryWrapper.orderByDesc("operate_time");
                if (super.list(queryWrapper) != null && super.list(queryWrapper).size() > 0) {
                    List<OmsStandardDataResult> list = super.list(queryWrapper);
                    redisUtil.set("调试:4-1-01执行标准数据悬停-正常结束-查到的值", list.get(0));
                    return list.get(0);
                }
                count--;
                Thread.sleep(10);
            }
            redisUtil.set("调试:4-1-01执行标准数据悬停-循环结束，报错", "");
            throw new BizException("-1", false);
        } catch (Exception e) {
            e.printStackTrace();
            redisUtil.set("调试:4-1-01执行标准数据悬停-报错", e);
            throw new BizException("-1", e, false);
        }


    }


    /**
     * 4-01-01批量查询标准数据By归属内容表主键ID[10270]
     * gen by moon at 10/15/2024, 8:44:51 PM
     */
    @Trace(operationName = "4-01-01批量查询标准数据By归属内容表主键ID")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataBySmallUpdate(BatchQueryStandardDataBySmallUpdateReq reqDto) {

        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getStandardDataList() == null || reqDto.getStandardDataList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("entity_id", reqDto.getStandardDataList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("data_result");
            queryWrapper.orderByDesc("create_time");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsStandardDataResult>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01批量查询标准数据列表异常场景（手写）[10276]
     * gen by moon at 10/19/2024, 9:20:16 PM
     */
    @Trace(operationName = "4-01-01批量查询标准数据列表异常场景（手写）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsStandardDataResult> batchQueryStandardDataListAbnormal(BatchQueryStandardDataListAbnormalReq reqDto) {
        try {
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();
            if (reqDto.getUpdateCycleEndTime() != null) {
                queryWrapper.le("update_cycle_end_time", reqDto.getUpdateCycleEndTime());
                reqDto.setUpdateCycleEndTime(null);
            }
            reqDto.setIsValid("FALSE");
            if (CollectionUtil.isNotEmpty(reqDto.getStandardDataList())) {
                queryWrapper.in("entity_id", reqDto.getStandardDataList());
            }

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsStandardDataResult.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);

            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsStandardDataResult.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("update_cycle_end_time");
            List<OmsStandardDataResult> data = (List<OmsStandardDataResult>) super.list(queryWrapper);
            Map<String, OmsStandardDataResult> dataIndex = new HashMap<>();
            for (OmsStandardDataResult one : data) {
                if (!dataIndex.containsKey(one.getEntityId())) {
                    dataIndex.put(one.getEntityId(), one);
                }
            }
            if (dataIndex.values() == null) {
                return new ArrayList<>();
            }
            return new ArrayList<>(dataIndex.values());
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 4-01-01查询标准数据详情by小于等于开始时间大于等于结束时间[10277]
     * gen by moon at 10/22/2024, 12:06:42 AM
     */
    @Trace(operationName = "4-01-01查询标准数据详情by小于等于开始时间大于等于结束时间")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsStandardDataResult queryStandardDataBySmallStartAndBigEndDetail(QueryStandardDataBySmallStartAndBigEndDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsStandardDataResult> queryWrapper = new QueryWrapper<>();

            // TODO: 2024/10/22
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsStandardDataResult> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsStandardDataResult retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

}

